﻿using System;
using System.Data;
using System.Collections;
using CE.Database;

/// <summary>
/// Summary description for PaymentDB
/// </summary>
/// 
namespace CE.Payment
{
    public class PaymentDB
    {
        public PaymentDB()
        {
            //
            // TODO: Add constructor logic here
            //
        }

        public Int64 Insert(Payment payment)
        {
            MyDatabase _db = new MyDatabase("TH.CX_DB_Payment_ConnectionString");
            Int64 _result = -1;
            string _spName = "sprocCXPaymentsInsertUpdateSingleItem";

            SortedList _sPara = new SortedList();

            #region Parameter
            _sPara.Add("@CXPaymentId", payment.CXPaymentId);
            _sPara.Add("@RefId", payment.RefId);
            _sPara.Add("@ProviderCompanyId", payment.ProviderCompanyId);
            _sPara.Add("@InsuranceType", payment.InsuranceType);
            _sPara.Add("@NameoftheCard", payment.NameoftheCard);
            _sPara.Add("@IssuingBankName", payment.IssuingBankName);
            _sPara.Add("@CreditCardNo", payment.CreditCardNo);
            _sPara.Add("@CardExpiryMonth", payment.CardExpiryMonth);
            _sPara.Add("@CardExpiryYear", payment.CardExpiryYear);
            _sPara.Add("@CardType", payment.CardType);
            _sPara.Add("@Status", payment.Status);
            _sPara.Add("@RefCEUserId", payment.RefCEUserId);

            #endregion

            _result = _db.ExecuteSP(_spName, _sPara);

            return _result;
        }

    }
}